<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Attachment Mailer documentation</title>
</head>

<body>
<h2>Attachment Mailer documentation <span style="font-size:12px;">ver. 1.0 / jan. 2006</span></h2>
<p>Use this class if you need to send attachments inside your application. At the moment this class will send text only mails with multiple attatchements. I wrote this class to use it togther with classes like Access_user or DB_cart. If you need some upload functionality than the easy upload class should be good for you.</p>
<h3>Features</h3>
<ul>
  <li>e-mail address check (regex and MX record)</li>
  <li>Internet form mail spam prevention</li>
  <li>Multiple attachments</li>
  <li>Cc and Bcc addresses are possible</li>
</ul>
<p>For a first test unpack all files into a directory, and modify this row inside the example file (the example attachment files are an image and an image inside a zip file):</p>
<p><b>require($_SERVER['DOCUMENT_ROOT'].&quot;/classes/attach_mailer/attach_mailer_class.php&quot;);</b> </p>
<h3>Important variables</h3>
<p><b>define(&quot;LIBR&quot;, &quot;\r\n&quot;);</b><br>
This is a very important variable, in some cases you have to switch between &quot;\r\n&quot; and &quot;\n&quot;. </p>
<p><b>var $mail_priority = 3; </b><br>
The mail priority, possible values are: 3 = normal, 2 = high, 4 = low (or others be carefull)</p>
<h3>Public methods</h3>
<p><b>attach_mailer($name = "", $from, $to, $cc = "", $bcc = "", $subject = "", $body = "")</b><br>
The counstructor method, the attributes "$from" and "$to" are required. While creating an object only the input (e-mail addresses) is validated and if all data is OK a boolean is set. Only if the boolean ($valid_mail_adresses) is "true" a mail will be send.</p>
<p><b>create_attachment_part($file, $dispo = "attachment")</b><br>
Use this method for every attachment you want to sell, inside a loop its very easy to handle a dynamic number of files. The second attrubute "$dispo" is important for a later version if hhtml is possible. (switch between "attachment" and "inline")</p>
<p><b>process_mail()</b><br>
This method wil send the mail if the boolean ($valid_mail_adresses) is "true". You have to know that its also possible to send an empty mail with only the "from" and "to" e-mail addresses.</p>
<p><b>get_msg_str()</b><br>
This method is used to output all messages (from the array $msg) created while using the class.</p>
<h3><b>Example code</b></h3>
<p>
  <textarea cols="60" rows="8" style="font-family:'Courier New', Courier, monospace;color:#0000FF;font-weight:bold;">$test = new attach_mailer("Olaf Lederer", "me@mail.com", "you@gmail.com", "copy@provider.com", "blind@copy.org", "Test mime email class subject", "Some body text");
  
$test->create_attachment_part("example.zip");
$test->create_attachment_part("image.gif");
$test->process_mail();</textarea>
</p>
<p>This example will send a short mail with to attachments to three e-mail addresses (to, Cc and Bcc). </p>
<p>&nbsp;</p>
</body>
</html>
